package com.dcrzl.shcz.common.excel;

import com.alibaba.excel.converters.doubleconverter.DoubleStringConverter;
import com.alibaba.excel.converters.integer.IntegerStringConverter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.dcrzl.shcz.common.utils.SysConstant;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;
@Slf4j
public class MyRateConverter extends DoubleStringConverter {
    @Override
    public WriteCellData<?> convertToExcelData(Double value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {

        String s = "";
        if(Objects.nonNull(value)){
            s = value+"%";
        }
        return new WriteCellData<String>(s);
    }
}
